import requests
# def get_fp():
#     """
#     随机指纹
#     """
#     import time
#     import random
#     e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
#     t = len(e)
#     milliseconds = int(round(time.time() * 1000))
#     base36 = ''
#     while milliseconds > 0:
#         remainder = milliseconds % 36
#         if remainder < 10:
#             base36 = str(remainder) + base36
#         else:
#             base36 = chr(ord('a') + remainder - 10) + base36
#         milliseconds = int(milliseconds / 36)
#     r = base36
#     o = [''] * 36
#     o[8] = o[13] = o[18] = o[23] = '_'
#     o[14] = '4'
#
#     for i in range(36):
#         if not o[i]:
#             n = 0 or int(random.random() * t)
#             if i == 19:
#                 n = 3 & n | 8
#             o[i] = e[n]
#     ret = "verify_" + r + "_" + ''.join(o)
#     return ret
#
# headers = {
#     "Accept": "application/json, text/plain, */*",
#     "Accept-Language": "zh-CN,zh;q=0.9",
#     "Cache-Control": "no-cache",
#     "Connection": "keep-alive",
#     "Content-Type": "application/x-www-form-urlencoded",
#     "Origin": "https://haohuo.jinritemai.com",
#     "Pragma": "no-cache",
#     "Referer": "https://haohuo.jinritemai.com/ecommerce/trade/detail/index.html?id=3634653387691285185&ins_activity_param=id5J6q7J&origin_type=pc_buyin_group&pick_source=v.bw0o7",
# }
#
# cookies = {
#     "sessionid": 'e926b3ade98e099c4abd4fa2ab1fceb7',  # jl-cookie
# }
#
#
#
# params = {
#     "is_h5": "1",
#     "is_native_h5": "1",
#     "verifyFp": get_fp(),
#     "origin_type": "pc_buyin_group",
#     "msToken": "",
#     "a_bogus": "",
# }
# data = {
#     "ui_params": "{\"from_live\":false,\"from_video\":null,\"three_d_log_data\":null,\"follow_status\":null,\"which_account\":null,\"ad_log_extra\":null,\"from_group_id\":null,\"bolt_param\":null,\"transition_tracker_data\":null,\"selected_ids\":null,\"window_reposition\":null,\"is_short_screen\":null,\"full_mode\":true}",
#     "use_new_price": "1",
#     "is_h5": "1",
#     "bff_type": "2",
#     "is_in_app": "0",
#     "promotion_ids": '3634653387691285185',
#     "meta_param": "",
#     "source_page": "",
#     "request_additions": "",
#     "isFromVideo": "false",
#     "enable_timing": "true"
# }
# resp = requests.post("https://ecom5-normal-hl.ecombdapi.com/aweme/v2/shop/promotion/pack/h5/",
#                      headers=headers,
#                      cookies=cookies,
#                      params=params,
#                      data=data)
#
# print(
#     resp.json()
# )
# 测试
url = "http://203.57.239.243:9000/cute_api/dy_api/promotion"

# url = "http://127.0.0.1:9000/cute_api/dy_api/promotion"
headers = {
    'signature':'e10adc3949ba59abbe56e057f20f883e'
}
data = {
    'promotion_ids': '3643585919199640874' # 3643585919199640874 3634653387691285185
}
resp = requests.post(url, json=data, headers=headers)

print(
    resp.json()
)